package ltd.itlover.yqblog.network;

import java.util.List;


import io.reactivex.Observable;
import ltd.itlover.yqblog.entity.Blog;
import ltd.itlover.yqblog.entity.BlogListBrief;
import ltd.itlover.yqblog.dto.Result;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface BlogApiService {
    @GET("/blog/blogs/{currentPage}")
    Observable<Result<List<BlogListBrief>>> getBlogBriefList(@Path("currentPage") Integer currentPage);

    @GET("/blog/detail/{blogId}")
    Observable<Result<BlogListBrief>> getBlogDetail(@Path("blogId") Long blogId);

    @POST("/blogLikes/add/{blogId}")
    Observable<Result<String>> likeABlog(@Path("blogId") Long blogId);

    @DELETE("/blogLikes/delete/{blogId}")
    Observable<Result<String>> cancelLikeABlog(@Path("blogId") Long blogId);

    @POST("/blog/edit")
    Observable<Result<String>> blogEdit(@Body Blog blog);
}
